import prompt from '@system.prompt';
import router from '@system.router';
export default {
    data(){
        return{
            selectList:["地震","火灾","洪水","泥石流"],
            disastercat:"地震",
            detail:'',
            judgee:this.$app.$def.globalData.judgee,
        }
    },
    selectChange(e){
        for(let i = 0;i<this.selectList.length;i++){
            if(e.newValue == this.selectList[i]){
                console.log(e.newValue);
                //                this.$element("picker"+i).show();
                console.log(e.newValue);
                this.disastercat=e.newvalue;
            }
        }
    },
    handleChooseImg(){
        this.$app.$def.globalData.judgee=1;
        router.push({

            uri:'pages/homepage/cameraa/cameraa',
            params:{
                routenum:2
            }
        })

    },
    handleTextInput(e){
        this.detail=e.value;
        console.log(this.detail);

    },
    fankui(){
        if(this.judgee==1){
            prompt.showToast({
                message: '请上传图片',
                duration: 2000,
            });
        }else{
            prompt.showToast({
                message: '提交成功',
                duration: 2000,
            });
            setTimeout(()=>{
                router.push({
                    uri:'pages/firstpage/firstpage',

                })
            },2000);
        }
    },
}
